package com.Test;

/**
 * @date 2022/10/26 18:36
 */
public class TestThread {
    static boolean flag = true;

    public static void main(String[] args) {


        new Thread(() -> {
            System.out.println("111");

            while (flag) {
                synchronized (Object.class) {

                }

            }


            System.out.println("111");

        }).start();

        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        flag = false;

    }
}
